<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* Flex container */
        .flex-container {
            display: flex;
            flex-wrap: wrap;
            /* Allow items to wrap to new lines */
            justify-content: space-between;
            /* Space between items */
            align-items: center;
            /* Center items vertically */
            background-color: #f2f2f2;
            padding: 10px;
        }

        /* Flex items */
        .flex-item {
            flex: 0 0 auto;
            /* flex-grow, flex-shrink, flex-basis */
            margin: 10px;
            padding: 20px;
            background-color: #66b3ff;
            color: white;
            text-align: center;
            border-radius: 5px;
        }
    </style>
</head>

<body>
    <p>flex属性是flex-grow, flex-shrink 和 flex-basis的简写，默认值为0 1 auto。后两个属性可选。</p>

    <p>flex: none | [ <'flex-grow'> <'flex-shrink'>? || <'flex-basis'> ]</p>

    <p>该属性有两个快捷值：auto=(1 1 auto) 和 none=(0 0 auto)。</p>

    <p>auto=(1 1 auto): 占用剩余空间，缩放，basis默认值</p>

    <p>none=(0 0 auto):不占用剩余空间，不缩放，basis默认值 </p>

    <div class="flex-container">
        <div class="flex-item">Item 1</div>
        <div class="flex-item">Item 2</div>
        <div class="flex-item">Item 3</div>
        <div class="flex-item">Item 4</div>
        <div class="flex-item">Item 5</div>
    </div>
</body>

</html>